/*
 * @Author: wwssaabb
 * @Date: 2021-12-04 10:04:09
 * @LastEditTime: 2021-12-04 10:19:55
 * @FilePath: \handwritten-code\vue\watcher.js
 */

import Dep from "./dep"

export default class Watcher {
  constructor(expOrFn, isRenderWatcher) {
    this.getter = expOrFn
    this.get()
  }

  get() {
    //执行当前的watcher
    Dep.target = this
    this.getter()
    Dep.target = null
  }

  update() {
    this.get()
  }
}